package com.kzn.entity;

public class Rect {
    private String name;
    private Double x;
    private Double y;
    private Double ex;
    private Double ey;


    public Rect() {
    }

    public Rect(String name, Double x, Double y, Double ex, Double ey) {
        this.name = name;
        this.x = x;
        this.y = y;
        this.ex = ex;
        this.ey = ey;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Double getX() {
        return x;
    }

    public void setX(Double x) {
        this.x = x;
    }

    public Double getY() {
        return y;
    }

    public void setY(Double y) {
        this.y = y;
    }

    public Double getEx() {
        return ex;
    }

    public void setEx(Double ex) {
        this.ex = ex;
    }

    public Double getEy() {
        return ey;
    }

    public void setEy(Double ey) {
        this.ey = ey;
    }

    public String getYOLO() {
        return " " + (x + ex) / 2 +
                " " + (y + ey) / 2 +
                " " + (ex - x) +
                " " + (ey - y);
    }

    @Override
    public String toString() {
        return
                name +
                        " " + x +
                        " " + y +
                        " " + ex +
                        " " + ey;
    }
}
